package com.lpf.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

// 声明controller的第一种方式
@Controller(value = "/prefix_Controller")
@RequestMapping(value = "prefix_RequestMapping")
public class TestController {

    @RequestMapping(value = "/test1.do", consumes = "application/*", produces = "text/plain")
    @ResponseBody
    public Object test(String name, HttpServletRequest request, HttpServletResponse response) {
        return "调用了test方法";
    }

    @RequestMapping(value = "/model.do")
    @ResponseBody
    public String model(HttpServletRequest request) {
        return "index.html";
    }

}
